﻿@using NTQOnlineExam.Services.Infrastructure.MVC
@using NTQOnlineExamFrontend.Models
@model NTQOnlineExamFrontend.Models.ExaminationHistoryViewModel


@if (Model.Exams != null)
{
    foreach (var item in Model.Exams)
    {
    <tr>
        <td>@item.TermId</td>
        <td>@item.TermName</td>
        <td>@item.Score</td>
        <td>@item.CreateDate</td>
        <td>
            <a href="@Url.RouteUrl(new { Controller = "Member", Action = "Examination", selectedTerm = item.TermId })">Retake exam</a>
        </td>
    </tr>
    }
}

@*TODO: Use this to paging *@
||||||||

@{
    var pagingModel = new PagingModel
    {
        PageCount = Model.PageCount,
        SelectedPage = Model.SelectedPage,
        Href = string.Empty,
        OnClickFunction = "ChangeHistoryPage"
    };
    Html.RenderPartial("_Paging", pagingModel);
}

<script type="text/javascript">
    function ChangeHistoryPage(page) {
        $("#exam-history-selectedpage").val(page);
        NQTSort.RequestData();
    }
</script>

